package com.competitions.videoedithelper.service.impl;

import com.competitions.videoedithelper.dao.AudioSegmentDao;
import com.competitions.videoedithelper.entity.AudioSegment;
import com.competitions.videoedithelper.entity.ResponseModel;
import com.competitions.videoedithelper.service.AudioSegService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 盛旭雯
 */
@Service
public class AudioSegServiceImpl implements AudioSegService {

    private AudioSegmentDao audioSegmentDao;

    @Autowired
    public AudioSegServiceImpl(AudioSegmentDao audioSegmentDao) {
        this.audioSegmentDao = audioSegmentDao;
    }

    @Override
    public ResponseModel selectAudioSeg(String id) {
        AudioSegment audioSegment=audioSegmentDao.selectAudioSegment(id);
        if(audioSegment!=null){
            return new ResponseModel(200,"查询成功",audioSegment);
        }else {
            return new ResponseModel(160,"该音频片段不存在");
        }
    }
}
